<route lang="json5" type="page">
{
	style: { navigationBarTitleText: '' },
}
</route>

<template>
	<view class="w-full h-[100vh]" v-if="!is_img">
		<web-view v-if="webInfo.url" :src="webInfo.url"></web-view>
		<no-page v-else type="msg" :title="title"></no-page>
	</view>
	<view class="page" v-if="is_img">
		<image src="../../static/data.jpg" class="img" mode="widthFix"></image>
	</view>
</template>

<script lang="ts" setup>
const title = ref('');
const thisPage = ref(-1);
const webInfo = ref(null);
const is_img = ref(false);

onLoad((option) => {
	console.log(option);
	if(option.img == 1) {
		is_img.value = true
	}
});

onShow(() => {
	const info = uni.getStorageSync('webInfo');
	if (info?.title) {
		uni.setNavigationBarTitle({
			title: info.title,
		});
	}
	if (info && info.url) {
		webInfo.value = { ...info };
	} else {
		thisPage.value = 0;
		title.value = '查询异常';
	}
});

onHide(() => {
	if (uni.getStorageSync('webInfo')) {
		uni.removeStorageSync('webInfo');
	}
});
</script>

<style lang="scss" scoped>
//
.page {
	width: 100vw;
	height: 100vh;
	.img {
		width: 100%;
	}
}
</style>
